<?php
declare (strict_types=1);

namespace app\common\builder;

use think\facade\Cache;
use think\facade\Request;

class TableTool
{

    public static function getName($name, $key = '')
    {
        $module = app('http')->getName();
        if (!$name) {
            $name = Request::controller() . '_' . Request::action();
        }

        return $key ? $key . '_' . strtolower($module . '_' . $name) : strtolower($module . '_' . $name);

    }

    public static function clearName($name)
    {
        Cache::delete($name);
    }
}
